<template>
	<div>
		<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
			<a-row type="flex" justify="center">
				<a-col :span="4">
					<a-form-model-item label="是否图案款">
						<a-select v-model="form.ispic" placeholder="请选择是否图案款">
							<a-select-option value="true"> 是 </a-select-option>
							<a-select-option value="false"> 否 </a-select-option>
						</a-select>
					</a-form-model-item>
				</a-col>
				<a-col :span="4">
					<a-form-model-item label="LME">
						<a-select v-model="form.lemline" placeholder="请选择LME">
							<a-select-option value="L"> L </a-select-option>
							<a-select-option value="M"> M </a-select-option>
							<a-select-option value="E"> E </a-select-option>
						</a-select>
					</a-form-model-item>
				</a-col>
				<a-col :span="4">
					<a-form-model-item label="系列">
						<a-input v-model="form.pattren2" placeholder="请输入系列" />
					</a-form-model-item>
				</a-col>
				<a-col :span="4">
					<a-form-model-item label="性别">
						<a-select v-model="form.bandg2" placeholder="请选择性别">
							<a-select-option value="B"> 男 </a-select-option>
							<a-select-option value="G"> 女 </a-select-option>
							<a-select-option value="L"> 特殊尺码 </a-select-option>
						</a-select>
					</a-form-model-item>
				</a-col>
			</a-row>
			<a-row type="flex" justify="center">
				<a-col :span="4">
					<a-form-model-item label="款式关联性">
						<a-select v-model="form.ksglx" placeholder="请选择款式关联性">
							<a-select-option value="shanghai"> Zone one </a-select-option>
							<a-select-option value="beijing"> Zone two </a-select-option>
						</a-select>
					</a-form-model-item>
				</a-col>
				<a-col :span="4">
					<a-form-model-item label="关联样衣号">
						<a-select v-model="form.glyyh" placeholder="请选择关联样衣号">
							<a-select-option value="shanghai"> Zone one </a-select-option>
							<a-select-option value="beijing"> Zone two </a-select-option>
						</a-select>
					</a-form-model-item>
				</a-col>
				<a-col :span="4">
					<a-form-model-item label="Look编号">
						<a-input v-model="form.lookno" placeholder="多选" />
					</a-form-model-item>
				</a-col>
				<a-col :span="4">
					<a-form-model-item label="尺码段">
						<a-select v-model="form.bandg" placeholder="请选择尺码段">
							<a-select-option value="B"> 标准尺码段 </a-select-option>
							<a-select-option value="L"> 特殊尺码段 </a-select-option>
						</a-select>
					</a-form-model-item>
				</a-col>

			</a-row>
			<!-- <div style="margin-left: -30%;"> -->
			<a-row type="flex" justify="start" style="margin-left: 16.3%;">
				<a-col :span="5">
					<a-form-model-item label="原样衣件数">
						<a-input v-model="form.yyyjs" type="number" placeholder="手工输入" />
					</a-form-model-item>
				</a-col>
			</a-row>
			<a-row type="flex" justify="start" style="margin-left: 16.3%;">
				<a-col :span="5">
					<a-form-model-item label="原样衣信息">
						<a-input v-model="form.yyyxx" placeholder="手工输入" style="width: 100%;" />
					</a-form-model-item>
				</a-col>
			</a-row>
			<a-row type="flex" justify="start" style="margin-left: 7.5%;">
				<a-col :span="10">
					<a-form-model-item label="扩色版缩率">
						<span>经</span>
						<a-input v-model="form.zm1" placeholder="手工输入" style="width: 100px;" class="parquet" />%,
						<span>纬</span>
						<span> <a-input v-model="form.zm" placeholder="手工输入" style="width: 100px;"
								class="parquet" />%</span>
					</a-form-model-item>
				</a-col>
			</a-row>
			<!-- <div style="margin-left: 15%;"> -->
			<a-row type="flex" justify="start" style="margin-left: 15.5%;">
				<a-col :span="5">
					<a-form-model-item label="毛衫标签">
						<a-select v-model="form.cattype" placeholder="下拉选择">
							<a-select-option value="shanghai"> Zone one </a-select-option>
							<a-select-option value="beijing"> Zone two </a-select-option>
						</a-select>
					</a-form-model-item>
				</a-col>
			</a-row>
			<a-row type="flex" justify="start" style="margin-left: 15.5%;">
				<a-col :span="5">
					<a-form-model-item label="历史看款">
						<a-input v-model="form.hisreview" placeholder="手工输入" disabled />
					</a-form-model-item>
				</a-col>
			</a-row>
			<a-row type="flex" justify="start" style="margin-left: 15.5%;">
				<a-col :span="5">
					<a-form-model-item label="扩色看款">
						<a-input v-model="form.ksreview" placeholder="手工输入" disabled />
					</a-form-model-item>
				</a-col>
			</a-row>
			<!-- </div> -->
			<a-row type="flex" justify="start" style="margin-left: -19.9%;">
				<a-col :span="20">
					<a-form-model-item label="拼皮">
						<a-input v-model="form.pj" placeholder="系统判断" disabled style="width: 100px;" />
						<span class="parquet">拼横几片</span>
						<a-input v-model="form.pl" placeholder="系统判断" disabled style="width: 100px;" />
						<span class="parquet">拼梭织</span>
						<a-input v-model="form.ispsz" placeholder="系统判断" disabled style="width: 100px;" />
						<span class="parquet">是否有内配</span>
						<a-input v-model="form.np" placeholder="系统判断" disabled style="width: 100px;" />
						<span class="parquet">几件套</span>
						<a-input v-model="form.jjt" placeholder="系统判断" disabled style="width: 100px;" />
					</a-form-model-item>
				</a-col>
			</a-row>
			<!-- </div> -->
		</a-form-model>
		<a-button type="primary" style="margin: 0 0 0 266px;" @click="save">
		      保存
		</a-button>
	</div>
</template>
<script>
	import {
		getNewStyleHeadKsOtherInfo,
		newStyleHeadKsOtherSave
	} from '@api/spection/index'
	export default {
		name: 'information',
		data() {
			return {
				username: JSON.parse(localStorage.getItem('pro__Login_Userinfo')),
				labelCol: {
					span: 10
				},
				wrapperCol: {
					span: 14
				},
				form: {
					ispic:'',
					lmeline:'',
					pattern2:'',
					bandg2:'',
					ksglx:'',
					glyyh:'',
					lookno:'',
					bandg:'',
					yyyjs:'',
					yyyxx:'',
					zm1:'',
					zm:'',
					cattype:'',
					hisreview:'',
					ksreview:'',
					pj:'',
					pl:'',
					ispsz:'',
					np:'',
					jjt:'',
					originalsample:''
				}
			}
		},
		mounted() {
			this.getList()
		},
		methods: {
			onSubmit() {
				console.log('submit!', this.form)
			},
			save(){
				this.newStyleHeadKsOtherSave()
			},
			async getList() {
				const res = await getNewStyleHeadKsOtherInfo(this.$route.query.billNo)
				if (res.code == 200) {
					console.log(res)
					this.form = res.data
				} else {
					if (res.msg) {
						this.$message.error(res.msg)
					} else {
						this.$message.error('获取待办列表失败！')
					}
				}
			},
			async newStyleHeadKsOtherSave() {
				this.form.username = this.username.value.phone
				this.form.jobNumber = this.username.value.workNo
				this.form.roleCodeList = this.username.value.roleCode
				const res = await newStyleHeadKsOtherSave(this.form)
				if (res.code == 200) {
					console.log(res)
					this.$message.success(res.msg)
					this.getList()
				} else {
					if (res.msg) {
						this.$message.error(res.msg)
					} else {
						this.$message.error('获取待办列表失败！')
					}
				}
			},
		}
	}
</script>
<style scoped lang="less">
	.parquet {
		margin: 0px 10px;
	}
</style>